import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule, Routes } from '@angular/router';
import { ReactiveFormsModule } from '@angular/forms';

import { AppComponent } from './app.component';
import { ListComponent } from './list/list.component';
import { FormComponent } from './form/form.component';
import { PrintComponent } from './print/print.component';
import { SummaryComponent } from './summary/summary.component';
import { AssessmentComponent } from './assessment/assessment.component';
import { AgreementComponent } from './agreement/agreement.component';

// 定义路由配置
const routes: Routes = [
  { path: '', component: PrintComponent }, // 默认路由
  { path: 'list', component: ListComponent }, // 列表页
  { path: 'form', component: FormComponent }, // 表单页
  { path: 'print', component: PrintComponent }, // 打印页
  { path: 'summary', component: SummaryComponent }, // 评价页
  { path: 'assessment', component: AssessmentComponent }, // 评估页
  { path: 'agreement', component: AgreementComponent }, // 实习协议书
  { path: '**', redirectTo: '' }, // 404页面重定向到首页
];
@NgModule({
  imports: [
    BrowserModule,
    ReactiveFormsModule,
    RouterModule.forRoot(routes), // 使用定义好的路由配置
  ],
  declarations: [
    AppComponent,
    ListComponent,
    FormComponent,
    PrintComponent,
    AssessmentComponent,
    AgreementComponent,
  ],
  bootstrap: [AppComponent],
})
export class AppModule {}
